<?php
	class Safe {
		private $safe ;
		private $safeEmail ;
		private $encryptedPassword ;
		
		public function makeSafe ( $unsafe ) {
			$this -> safe = htmlentities ( mysql_real_escape_string ( $unsafe ) ) ;
			return $this -> safe ;
		}
	
		public function makeSafeMail ( $unsafeMail ) {
			$this -> safeEmail = filter_var ( htmlentities ( mysql_real_escape_string ( $unsafeMail ) ), FILTER_SANITIZE_EMAIL) ;
			return $this -> safeEmail ;
		}
		
		public function makeMd5 ( $unEncryptedPassword ) {
			$this -> encryptedPassword = md5 ( htmlentities ( mysql_real_escape_string ( $unEncryptedPassword ) ) ) ;
			return $this -> encryptedPassword ;
		}
		
		// mail adresi geçerliyse True değilse false döndürür. 
		public function mailControl ( $unControlledEmail ) {
  			return filter_var ( $unControlledEmail, FILTER_VALIDATE_EMAIL ) ;
		}
		
		public function passwordControl ( $password, $password_c ) {
			if ( $password == $password_c ) {
				return true ;
			} else {
				return false ;
			}
		}
	}
?>
